package com.lungle.warmdiary.app.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by God on 2016/8/25.
 */
public class ShareHelperForPopWindows {
    public static String PACKAGE_NAME_QQ_FRIEND = "com.tencent.mobileqq";
    public static String PACKAGE_NAME_QQ_SPACE = "com.tencent.mobileqq";
    public static String PACKAGE_NAME_WECHAT_FRIEND = "com.tencent.mm";
    public static String PACKAGE_NAME_WECHAT_SPACE = "com.tencent.mm";
    public static String PACKAGE_SINA = "com.sina.weibo";
    final static List<String> shareList = new ArrayList() {
        {
            add(PACKAGE_NAME_WECHAT_FRIEND);
            add(PACKAGE_NAME_QQ_FRIEND);
            add(PACKAGE_NAME_WECHAT_SPACE);
            add(PACKAGE_SINA);
            add(PACKAGE_NAME_QQ_SPACE);
        }
    };

    // 微信好友 圈,  新浪微博  ,qq好友  qq好友圈
    public static String obtainInstallList() {
        StringBuilder sb = new StringBuilder();
        for (String packageName : shareList) {
            if (TDevice.isPackageExist(packageName)) {
                sb.append("1");
            } else {
                sb.append("0");
            }
        }
        return sb.toString();
    }


}
